//
//  StartViewController.m
//  跳转第三方地图
//
//  Created by apple on 2017/8/18.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "StartViewController.h"
#import "ViewController.h"
#import "LocationViewController.h"
@interface StartViewController ()

@end

@implementation StartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(50, 200, 200, 50)];
    
    [btn1 setTitle:@"显示多个地点" forState:UIControlStateNormal];
    
    [btn1 setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    
    [btn1 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    
    btn1.tag = 1;
    
    [self.view addSubview:btn1];
    
    
    UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(50, 400, 200, 50)];
    
    [btn2 setTitle:@"调用第三方地图" forState:UIControlStateNormal];
    
    [btn2 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    
    [btn2 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    
    btn2.tag = 2;
    
    [self.view addSubview:btn2];
}


- (void)btnClick:(UIButton *)sender{

    if (sender.tag == 1) {
        
        [self.navigationController pushViewController:[[ViewController alloc] init] animated:YES];
        
    }else{
    
        [self.navigationController pushViewController:[[LocationViewController alloc] init] animated:YES];
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
